package cn.saltybe.analysis.crawler.wbtc.wholeRentingHouse;

import com.geccocrawler.gecco.annotation.*;
import com.geccocrawler.gecco.request.HttpRequest;
import com.geccocrawler.gecco.spider.SpiderBean;

import java.util.List;

@Gecco(
        matchUrl = { "https://{}.58.com/zufang/", "https://{}.58.com/zufang/pn{page}/" },
        pipelines = { "wbtcWholeRentingHouseListPipeline" },
        downloader = "htmlUnitDownloader")
public class WbtcWholeRentingHouseList implements SpiderBean {
    @Request
    private HttpRequest request;

    public HttpRequest getRequest() {
        return request;
    }

    public void setRequest(HttpRequest request) {
        this.request = request;
    }

    @Href(click = false)
    @HtmlField(cssPath = "body > div.list-wrap > div.list-box > ul > li > div.des > h2 > a")
    private List<String> houseList;

    @Text
    @HtmlField(cssPath = "#pager_wrap > div > strong > span")
    private String currentPage;

    @Href(click = false)
    @HtmlField(cssPath = "#pager_wrap > div > a.next")
    private String nextPageUrl;

    public String getNextPageUrl() {
        return nextPageUrl;
    }

    public void setNextPageUrl(String nextPageUrl) {
        this.nextPageUrl = nextPageUrl;
    }

    public String getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(String currentPage) {
        this.currentPage = currentPage;
    }

    public List<java.lang.String> getHouseList() {
        return houseList;
    }

    public void setHouseList(List<java.lang.String> houseList) {
        this.houseList = houseList;
    }
}
